package cn.work100.modular.layuiMsn.layimUserAdmin;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/IsChatStatus")
public class IsChatStatus {

    @Resource
    private RedisTemplate redisTemplate;

    @RequestMapping("/isStatus")
    public String IsChatStatus(Long userid){
        Map<String,Object> userList = (Map<String,Object>) redisTemplate.opsForValue().get("onlineUserList");
        boolean b = userList.containsKey(userid.toString());
        return "{\"status\":"+b+"}";
    }
}
